home *** CD-ROM | disk | FTP | other *** search
- Path: news.th-darmstadt.de!news
- From: enno@inferenzsysteme.informatik.th-darmstadt.de (Enno Sandner)
- Newsgroups: comp.lang.c++
- Subject: Re: Circular Usage (forward declaration?)
- Date: 17 Apr 1996 20:05:47 +0200
- Organization: Fachbereich Informatik, TH Darmstadt
- Sender: enno@kitz.inferenzsysteme.informatik.th-darmstadt.de
- Message-ID: <lt20lmu3no.fsf@kitz.inferenzsysteme.informatik.th-darmstadt.de>
- References: <MRW.96Apr16184800@tobago.siemens.ch>
- <ltu3ykovzc.fsf@kitz.inferenzsysteme.informatik.th-darmstadt.de>
- <31747631.5970@datalytics.com> <MRW.96Apr17104121@tobago.siemens.ch>
- <MRW.96Apr17105737@tobago.siemens.ch>
- NNTP-Posting-Host: kitz.intellektik.informatik.th-darmstadt.de
- In-reply-to: mrw@tobago.siemens.ch's message of 17 Apr 1996 08:57:37 GMT
- X-Newsreader: Gnus v5.1
-
- In article <MRW.96Apr17105737@tobago.siemens.ch> mrw@tobago.siemens.ch (Waeckerlin Marc) writes:
-
- You have the same problem in other cases (yes I know there is an endless loop):
-
- class B;
-
- class A
- {
- public:
- void b(B &x)
- {
- x.a(*this);
- }
- };
-
- class B
- {
- public:
- void a(A &x)
- {
- x.b(*this);
- }
- };
-
-
- It does not even work with pointers:
-
- [ ... ]
-
- -> is there a solution or not?
- BTW: regarding the smart p[ointer example below - I know, that circular
- references and smart pointers normally don't work tokether, but you
- don't know how smart *these* smart pointers may be ;-) ...
-
- It works with pointers and references if you put the definitions of
- the member-functions at the right place, i.e. have a seperate
- implementation file.
-
- Enno
-